import java.util.Arrays;

/**
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/5/21 11:46
 */
public class Test6 {

    public static void main(String[] args) {
        int[] array = new int[]{1, 2, 4, 5, 5};
        int[] newArray = new int[5];
        System.arraycopy(array, 0, newArray, 0, Math.min(array.length, newArray.length));
        System.out.println(Arrays.toString(newArray));
    }
}
